package com.cby.ssm.service;

import com.cby.ssm.entity.UserEntity;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

/**
 * Created by 13296 on 2017/7/13.
 */
public interface UserService {
    /**
     * 用户功能
     * @param account
     * @param password
     * @return
     * @throws Exception
     */
    UserEntity login(String account,String password)throws Exception;
    List<UserEntity> searchAllUser()throws Exception;
    UserEntity searchUser(String id) throws Exception;
    List<UserEntity> searchUsers(String key) throws Exception;
    @Transactional
    UserEntity editUser(UserEntity u) throws Exception;
    boolean deleteUser(String deleteId,String notDeleteId) throws Exception;
    @Transactional   //提交事务
    UserEntity updatePassword(String id,String oldPassword,String newPassword,String newPasswordConfirm)throws Exception;
    @Transactional
    void addUser(String account,String passwordAgain,String password,String name,String sex,String telephone,String email,String address)throws Exception;

}
